import request from '@/utils/request'

//分页
export const getPageApI = (pageNum, pageSize, queryDto) => {
  return request({
    url: `/api/user/page/${pageNum}/${pageSize}`,
    method: 'post',
    data: queryDto,
  })
}

//添加
export const postUserAPI = data => {
  return request({
    url: '/api/user/save',
    method: 'post',
    data,
  })
}

//修改
export const putUserAPI = sysUser => {
  return request({
    url: '/api/user/update',
    method: 'put',
    data: sysUser,
  })
}

//删除
export const deleteUserAPI = id => {
  return request({
    url: `/api/user/delete/${id}`,
    method: 'delete',
  })
}

//保存分配的角色
export const postSaveAssignRoleAPI = assignRoleVo => {
  return request({
    url: '/api/user/saveAssignRole',
    method: 'post',
    data: assignRoleVo,
  })
}

//修改密码
export const putUpdatePassword = sysPasswordDto => {
  return request({
    url: '/api/user/updatePassword',
    method: 'put',
    data: sysPasswordDto, 
  })
}